﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace Bam.Lib.GameScreens
{
    class MainGameScreen : GameScreen
    {

        Texture2D bgTex;
        Texture2D arrow;

        ContentManager content;

        Vector2 arrowAnchor;
        Vector2 arrowPos;

        float arrowAngle = .8f;
        float arrowSpeed = .02f;

        public MainGameScreen(Game game)
        {
            content = game.Content;

            arrowAnchor = new Vector2(595,595);
            arrowPos = new Vector2(250, 718);
        }

        public override void LoadContent()
        {
            bgTex = content.Load<Texture2D>("Graphics\\background-texture");
            arrow = content.Load<Texture2D>("Graphics\\600px-Arrow_northwest.svg");
        }

        public override void Update(Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            KeyboardState state = Keyboard.GetState();

            if (state.IsKeyDown(Keys.Left))
                arrowSpeed -= .04f;
            if (state.IsKeyDown(Keys.Right))
                arrowSpeed += .04f;
        }

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            
            ScreenManager.SpriteBatch.Begin();
            ScreenManager.SpriteBatch.Draw(bgTex, new Vector2(10,10), Color.White);
            ScreenManager.SpriteBatch.Draw(arrow, arrowPos, null, Color.White, arrowAngle + arrowSpeed, arrowAnchor, .2f, SpriteEffects.None,0);
            ScreenManager.SpriteBatch.End();
        }

        public override void HandleInput(InputManager input)
        {
            
        }

        
    }


}
